package datatypes

/**
 * 1.声明变量 def 关键字，或数据类型
 * 2. 内置基本数据类型 byte,short,int,long,float,double ,char,Boolean,String,
 *    包装类型 Byte,Short,Integer,Long,Float,Double
 *      范围  当变量 超过范围时，类型自动识别
 *      byte	-128到127
 *      short	-32,768到32,767
 *      int		2,147,483,648 到,147,483,647
 *      long	    -9,223,372,036,854,775,808到+9,223,372,036,854,775,807
 *      float	1.40129846432481707e-45到3.40282346638528860e + 38
 *      double	4.94065645841246544e-324d 到1.79769313486231570e + 308d
 */
class DataTypes {

    static void main(String[] args) {
        def s1 = 2
        println s1.class
        def s2 = "4"
        println s2.class
        //类型指定
        def s3 =123l
        println s3.class
        //类型自动识别
        def s4 =2147483649
        println s4.class

        def of = Double.valueOf(s1)
        println of.class


    }
}
